Skip to content

Decompress PDF images in JavaScript - #56

Merged
ochafik merged 1 commit into
mainfrom
ochafik/pdf-js-inflate
Dec 2, 2026
Merged

ochafik merged 1 commit into
mainfrom
ochafik/pdf-js-inflate

Conversation

@ochafik

@ochafik ochafik commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Summary

The PDF example now decompresses PDF images in JavaScript instead of native code, as hardening for a server that opens PDFs from any URL.

pdf.js uses the native DecompressionStream when it exists and falls back to its own JavaScript otherwise. Removing that global selects the fallback.

Test plan

  • On Node 26.12.1, decoding a test PDF image used the JavaScript path and gave identical pixels.
  • npm run build, npm run lint and npm test pass.

Claude session #01CtESSS


Generated by Claude Code

pdf.js decompresses PDF images with the runtime's native DecompressionStream
when it exists. Removing that global selects its JavaScript decompressor, which
suits a server that opens PDFs from any URL.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CtESSS5aXn7L6Q6NqAp2TE
@ochafik
ochafik merged commit b65aa7b into main Dec 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants